package ch.exploadingelephants.graph;

import java.io.Serializable;

/**
 * @author Sandro De Zanet
 * 
 */
public enum DotColor implements Serializable {
    BLUE {
	@Override
	public char getCharacter() {
	    return 'b';
	}
    },
    RED {
	@Override
	public char getCharacter() {
	    return 'r';
	}
    },
    GREEN {
	@Override
	public char getCharacter() {
	    return 'g';
	}
    },
    YELLOW {
	@Override
	public char getCharacter() {
	    return 'y';
	}
    };

    /**
     * @param character
     * @return
     */
    public static DotColor parse(char character) {
	for (DotColor color : DotColor.values()) {
	    if (color.getCharacter() == character) {
		return color;
	    }
	}
	return null;
    }

    /**
     * @return
     */
    public abstract char getCharacter();

}
